if(!window.com){window.com = {}}

com.renderArticle = function(id,fun){
    //初始化
    var comObj =  $('.article-detail');
    //var art = $("#art-item");
    var dataNameList = comObj.find("[data-name]");
    var contentObj =  comObj.find('.content');

    app.ajax('get',app.url('getArticleDetail.php'),{id:id},function(data){
        var obj = data;
        if(!obj){
            $.comMessage({
                type:'warning',
                text:'文章加载失败!',
                time:3000,
                animateTop:'80px'
            });
            return;
        }

        for(var i=0;i<dataNameList.length;i++){
            var dataObj = $(dataNameList[i]);
            dataObj.text(obj[dataObj.attr('data-name')]);
        }

        fun && fun();

        var replaceStr = obj.text.replace(/"(.+)\./g,'"'+app.imgUrl('art/$1.'));
            contentObj.html(replaceStr);
            comObj.find('.art-overflow').removeClass('hide');
            comObj.css('-webkit-transform','translateX(-100%)');
    });

};